import { fetch }  from '../util/http.js';

/**
 * 获取推广列表数据
*/
export function getExtension(data){
  return fetch({
    url:'home/adv/search',
    method:'post',
    data:data
  });
}

/**
 * 添加推广
*/
export function addExtension(data){
  return fetch({
    url:'adv',
    method:'post',
    data:data
  });
}

/**
 * 删除推广
*/
export function delExtension(data){
  return fetch({
    url:'adv/'+data.id,
    method:'DELETE'
  });
}

/**
 * 获取要编辑推广数据
*/
export function getExidExtension(data){
  return fetch({
    url:'home/adv/'+data.id,
    method:'get'
  });
}

/**
 * 提交编辑数据
*/
export function exidExtension(data){
  return fetch({
    url:'adv',
    method:'PUT',
    data:data
  });
}